js get last 4 digits

124

js get last 4 digits -

const id = "ctl03_Tabs1";
console.log(id.slice(id.length - 5)); //Outputs: Tabs1
console.log(id.slice(id.length - 1)); //Outputs: 1

Comments

Submit
0 Comments